package Person.Buffer;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

public class OutputStreamwriteDemo {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("C:\\Users\\win10\\IdeaProjects\\IDEA\\bos.txt"));
//void write(int c);写一个字符
       /* osw.write(97);
//osw.flush();//刷新流
        osw.write(98);
        osw.write(99);*/
//void write（char[] cbuf）;写一个字符数组
        char[] chs = {'a','b','c','d','e'};
       // osw.write(chs);
//void write(char[] cbuf,int off,int len);自如字符数组的一部分
       // osw.write(chs,0,chs.length);
        //void write(String str):  写入一个字符串

        //void wrtie(String str,int off,int len):紫萼如字符串的一部分

        osw.write("abcde",0,2);
       osw.close();









    }
}
